Reducing a size of an application package

ABSTRACT

Some examples include techniques for efficiently handling an application package. For instance, a native code library used by an application may be identified. A wrapper library that enables the application to access the native code library may be created. The wrapper library may be stored in a first area of the application package. The native code library may be stored in a second area of the application package. If the application package includes more than one native code library, the application package may include a loading order specifying an order in which the native code libraries are to be loaded into a memory of a computing device.

CROSS REFERENCE TO RELATED PATENT APPLICATIONS

This application is a continuation of and claims priority from U.S.patent application Ser. No. 13/595,799 titled “Reducing a Size of anApplication Package,” filed on Aug. 27, 2012, which is hereinincorporated by reference in its entirety.

BACKGROUND

Computing devices may use a variety of operating systems. Some operatingsystems may not efficiently handle application packages. An applicationpackage may include an application and one or more code libraries, suchas native code libraries, that are used by an application. Inefficienthandling of application packages may detract from a user's experiencewhen interacting with the computing devices.

BRIEF DESCRIPTION OF THE DRAWINGS

The detailed description is described with reference to the accompanyingfigures. In the figures, the left-most digit(s) of a reference numberidentifies the figure in which the reference number first appears. Thesame reference numbers in different figures indicate similar oridentical items.

FIG. 1 is an illustrative architecture that includes creating anapplication package that includes a wrapper library according to someembodiments.

FIG. 2 is an illustrative architecture that includes installing awrapper library and native code libraries according to some embodiments.

FIG. 3 is a flow diagram of an illustrative process to create anapplication package according to some embodiments.

FIG. 4 is a flow diagram of an illustrative process to install anapplication package in a computing device according to some embodiments.

FIG. 5 is a flow diagram of an illustrative process to load native codelibraries into a memory of a computing device according to someembodiments.

DETAILED DESCRIPTION

The systems and techniques described herein may be used to createapplication packages (APK). For example, an application package may becreated on a server for installation on multiple computing devices, suchas mobile phones, tablet computing devices, and/or electronic book(eBook) readers. In some implementations, the application package may bea file that includes an application and one or more code libraries, suchas native code libraries, that are used by the application. For example,the term native code may refer to computer programming (code) that iscompiled to run with a particular processor (such as an Intel x86-classprocessor or an ARM processor) using a set of instructions that theprocessor is capable of executing. Consequently, if the same program isrun on a computer with a different processor, software may be providedso that the computer emulates the original processor. In this case, theoriginal program may run in “emulation mode” on the different processor.However, the code may run more slowly in emulation module as compared torunning in native mode on the original processor.

In some examples, herein, the native code library may includeinstructions that the processor can natively execute, e.g., instructionsfrom an instruction set of the processor, without using an emulationmode, a virtual machine, or the like. Thus, the native code librariesprovided herein may be more efficient in terms of execution speed andcode size compared to a scripting language, but may involve constructinga compiler to compile the programs to the native code for each supportedhardware device. For example, the native code libraries may be used forcertain tasks, such as time critical calculations or computationallyintensive tasks, while applications that are written in a programminglanguage that is interpreted by a virtual machine at runtime may be usedfor other tasks, such as non-time critical or non-computationallyintensive tasks. In addition, to achieve a balance between portabilityand efficiency, some applications herein may be written in programminglanguages that run in emulation module (e.g., virtual machine) and theapplications may call native code libraries to perform functions thatare time critical, computationally intensive, or the like.

According to some examples herein, when creating an application package,one or more software applications may be selected for inclusion in theapplication package. For example, the one or more software applicationsmay be part of an application suite that provides a specific set offunctions. The one or more software applications may include calls to asubset of native code libraries for a particular hardware device. Insome cases, a server may examine the software applications to identifythe subset of native code libraries. Thus, the server may include thesoftware applications and the subset of native code libraries in theapplication package. In some implementations, at least a portion of thesoftware applications and the subset of native code libraries may becompressed and stored in the application package in a compressed format.

The server may determine whether two or more of the native codelibraries may have dependencies. The server may determine a loadingorder of the native code libraries based on the dependencies. In somecases, the loading order may specify an order in which the native codelibraries are to be loaded into a memory of a computing device. Forexample, library A may have a dependency on library B (e.g., library Bis to be loaded before library A) and library B may have a dependency onlibrary C (e.g., library C is to be loaded before library B). In thisexample, the loading order may be library C, followed by library B,followed by library A. The loading order may be explicit or implicit.For example, an explicit loading order may be specified in a loadingorder file, e.g., the loading order file may specify an order in whichto load the native code libraries. In addition to the loading order, thefile may include a location of each native code library in theapplication package. An implicit loading order may be specified bystoring the native code libraries in the application package in theorder in which the native code libraries are to be loaded into memory.If an implicit loading order is used, a loader may read the native codelibraries sequentially from the application package and load the nativecode libraries into a memory of the computing device in the order thatthe native code libraries were stored in the application package.Specifying a loading order (e.g., either explicitly or implicitly) inthe application package may reduce or eliminate a time taken by aninstaller on a computing device to determine dependencies and a loadingorder during installation of the application package on the computingdevice.

In some implementations, the server may include a custom loader in theapplication package. The custom loader may load the native codelibraries into a memory of a computing device based on the loadingorder. The custom loader may be provided in the application package forvarious reasons. For example, an application package installer on thecomputing device may install portions of the application package afterthe application package is received by the computing device (e.g.,during installation of the application package). In contrast, the customloader may load the native code libraries into a memory of the computingdevice when a particular application begins executing on the computingdevice.

Additionally, in some examples, to enable the software applications toaccess the native code library, a wrapper library may be created andstored in the application package. The wrapper library may be arelatively small layer of software code that is used to translate fromone interface to another interface. For example, a first application maymake a call to a second application to perform a particular function.Over time, the function performed by the second application may becomemore complex, more time critical, or both. A native code library may becreated to perform the function performed by the second application. Toavoid rewriting every application that calls the second application, awrapper library may be written to receive calls to the secondapplication and forward (e.g., translate) the calls to the native codelibrary. For example, the wrapper library may receive parameters X, Yand Z from the calling application and pass the parameters X, Y and Z tothe native code library function. The native code library function mayinitiate performing the requested function and return a result to thewrapper library. The result may include an outcome from performing thefunction, an indication as to whether the requested function wassuccessfully performed, whether an error occurred, a type of error thatoccurred, other information associated with the result, or anycombination thereof.

As one example, the server may create the wrapper library based on thesubset of native code libraries that are to be included in theapplication package. After creating the wrapper library, the server maystore the wrapper library in the application package. In some cases, atleast a portion of the wrapper library may be compressed and stored inthe application package in a compressed format. The custom loader andthe wrapper library may be packaged into a single file that is stored inthe application package.

In some implementations, the application package may be created by anapplication developer and the application package may be made availablefor acquisition in an application marketplace. In other implementations,the application package may be created “on demand,” e.g., in response toa request to acquire the application or in response to a serverdetermining that a computing device has an older version of anapplication that is to be updated to a newer version. Of course, in someother implementations, some application packages may be created byapplication developers while other application packages may be createdon demand.

In the examples described herein, an application package may have one ormore areas that are used for specific purposes. For example, theapplication package may include a first area (e.g., a library area) thatis used to store the wrapper libraries and a second area that is used tostore the native code libraries. The second area may be referred to as ahidden area because when an application package installer of thecomputing device is installing the application package, the applicationpackage installer may access the first area, but not access the secondarea. When the application package installer is installing theapplication package on the computing device, the application packageinstaller may extract one or more applications from the applicationpackage and install the applications on the computing device. If theapplications were stored in a compressed format in the applicationpackage, the application package installer may uncompress theapplications before installing the applications. In addition, theapplication package installer may access the first area and install thewrapper libraries and the custom loader. The application packageinstaller may store the application package in a file system (e.g.,memory) of the computing device. If the wrapper libraries and/or thecustom loader were stored in a compressed format in the applicationpackage, the application package installer may uncompress the wrapperlibraries and/or the custom loader before installing the wrapperlibraries and/or the custom loader. Thus, after an application packageis received by the computing device, an application package installermay install the application package by locating the wrapper library in alibrary area of the application package, uncompressing the wrapperlibrary (if needed), and installing the wrapper library into the memoryof the computing device. The amount of time taken to install theapplication package may be reduced because the application packageinstaller installs a relatively smaller wrapper library instead ofdetermining dependencies and installing native code libraries.

The native code libraries may remain stored in a compressed format inthe application package in the memory of the computing device until anapplication begins executing. For example, when execution of anapplication is initiated, the application may instruct the custom loaderto load native code libraries into the memory of the computing device toenable the application to call (e.g., use) the native code libraries.The custom loader may load the native code libraries based on theloading order (e.g., implicit loading order or explicit loading order)from the application package into the memory of the computing device.When the application ceases execution, the native code libraries may beunloaded (e.g., removed) from the memory of the computing device. Thus,the native code libraries may be loaded into a file system (e.g., amemory) of the computing device when an application is selected forexecution (e.g., at run-time) rather than when the application packageis installed. To prevent an application package installer frominstalling the native code libraries when installing the applicationpackage, the native code libraries may be stored in a hidden area of theapplication package. The hidden area may be an area of the applicationpackage that is not normally accessed by the application installer wheninstalling the application package (e.g., APK). Thus, storing the nativecode library in the hidden area may avoid loading two copies of thenative code libraries (e.g., the compressed native code libraries in theapplication package and the uncompressed native code libraries stored inthe file system of the computing device). Thus, an application packagecan be efficiently installed by using a single application package thatincludes a set of native code libraries that are used by one or moreapplications.

The systems and techniques described herein may (i) reduce memory usageby reducing duplication of native code libraries, (ii) reduceapplication package installation time (e.g., because a wrapper libraryrather than native code libraries are installed when the applicationpackage is installed), and (iii) reduce the time to load native codelibraries by providing a loading order (e.g., implicitly or explicitly)by resolving dependencies prior to installation of the applicationpackage. These efficiencies may result in a more enjoyable userexperience for a user who installs an application package on a computingdevice.

Illustrative Architecture

FIG. 1 is an illustrative architecture 100 that includes creating andsending an application package that includes a wrapper library accordingto some embodiments. The architecture 100 includes a client 102 coupledto a server 104 via a network 106. The server 104 may be comprised ofmultiple virtual servers, multiple physical servers, or a combination ofboth. The server 104 may include one or more processors 108 and one ormore computer-readable media 110 (e.g., memory). In some cases, theserver 104 may be associated with a merchant site that offers items(e.g., physical items or digital content items) for acquisition (e.g.,purchase or lease/rental). The server 104 may host a catalog thatincludes software applications (“apps”) that are available foracquisition.

As illustrated in FIG. 1, the computer readable media 110 includesnative code libraries 112 and an application library 114. Theapplication library 114 includes one or more applications that may beprovided to the computing device 102. At least some of the applicationsin the application library 114 may be available for acquisition. Theserver 104 may select one or more applications 116 from the applicationlibrary 114 and determine (e.g., identify) a subset 118 of the nativecode libraries 112 that may be used by the applications 116. Forexample, the server 104 may select the one or more applications 116 fromthe application library in response to (1) a request from the computingdevice 102 to acquire the one or more applications 116 or (2)determining that the one or more applications 116 are updated versionsof applications previously acquired by the computing device 102. Ofcourse, the computer readable media 110 may also include softwaremodules, device drivers, an operating system, and the like. The server104 may create a wrapper library 120 based on the selected applications116. The wrapper library may enable the applications 116 to access thesubset 118 of the native code libraries 112.

The computing device 102 may include one or more processors 122 and oneor more computer readable media 124 (e.g., memory). The computerreadable media 124 may include software modules, device drivers, anoperating system, and the like. The computing device 102 may be anelectronic book (eBook) reader device (102-1), a tablet computing device(102-2), a personal computer (102-3), a wireless phone or a portablemedia player (102-4), a laptop computer (102-5), a media device such asa television (102-6), another type of computing device, or anycombination thereof. One or more users 126 may interact with thecomputing device 102.

In operation, in some implementations, in response to (i) the server 104receiving a request 128 from the computing device 102 or (ii) the server104 determining that the computing device 102 is to be sent an update,the server 104 may create an application package 130. For example, oneof the users 126 may initiate acquisition of the software applications116 using the server 104. In response, the server 104 may create theapplication package 132. As another example, the server 104 maydetermine that an application or a native code library currently storedin the computing device 102 is to be updated and create the applicationpackage 132 for updating the computing device 102. In other cases, anapplication developer may create the application package 130. Theapplication developer may provide the application package 130 to amerchant that offers multiple application packages, including theapplication package 130, for acquisition.

The application package 130 may include zero or more applications 116.For example, the application package 130 may include zero applicationsif the application package 130 is used to update native code librariesthat are stored on the computing device 102. As another example, theapplication package 130 may include one or more of the applications 116from the application library 114 that are to be provided to thecomputing device 102.

The application package 130 may include a library area 132 (e.g., afirst area) and a hidden area 134 (e.g., a second area). The libraryarea 132 may be accessed by an application package installer provided byan operating system of the computing device 102. In contrast, the hiddenarea 134 may not be accessed by the application package installerprovided by the operating system of the computing device 102. The server104 may create the wrapper library 120 and store the wrapper library 120in the library area 132 of the application package 130. In some cases,the wrapper library 120 (or portions thereof) may be compressed beforebeing stored in the library area 132. For example, a compression formatsuch as zip or other similar compression format may be used to compressthe wrapper library 120.

The server 104 may identify the subset 118 of the native code libraries112 for inclusion in the application package 130. For example, theserver 104 may identify the subset 118 based on which of the native codelibraries 112 are used by the applications 116. To illustrate, thesubset 118 may include libraries from the native code libraries 112 thatare used by the applications 116 and exclude libraries from the nativecode libraries 112 that are not used by the applications 116.

The wrapper library 120 may enable applications executing on thecomputing device 102 to access the subset 118 of the native codelibraries 112 without using an operating system provided interface(e.g., such as JNI). For example, applications executing on thecomputing device 102 may call the wrapper library 120 and the wrapperlibrary 120 may in turn call the subset 118 along with any argumentsthat were passed in with the call. The server 104 may create the wrapperlibrary 120 based on the applications 116 that are included in theapplication package 130.

The server 104 may determine a loading order 136 for loading each nativecode library from the subset 118 of the native code libraries 112 whenthe subset 118 is loaded into the computer readable media 124 of thecomputing device 102. For example, the server 104 may determinedependencies 138 among each of the native code libraries of the subset118 and determine the loading order 136 based on the dependencies 138.In some implementations, the server 104 may store each native codelibrary of the subset 118 in the hidden area 134 of the applicationpackage 130 according to the loading order 136. In otherimplementations, the server 104 may store a file in the applicationpackage 130 that includes the loading order 136. The subset 118 (orportions thereof) may be compressed before being stored in the hiddenarea 134. For example, a compression format such as zip or other similarcompression format may be used to compress one or more of the nativecode libraries in the subset 118 before they are stored in the hiddenarea 134.

The server 104 may store a custom loader 140 in the application package130. For example, the custom loader 140 may be stored in the libraryarea 132 of the application package 130. In some cases, the customloader 140 and the wrapper library 120 may be stored in a single file inthe application package 130. The custom loader 140 may load the subset118 of the native code libraries 112 into the computer readable media124 of the computing device 102. For example, if each native codelibrary of the subset 118 is stored in the hidden area 134 according tothe loading order 136, the custom loader 140 may sequentially read andload each native code library from the subset 118. Thus, the subset 118of the native code libraries 112 may be efficiently loaded because theloader does not spend time determining the dependencies 138 prior toloading each of the native code libraries of the subset 118. Theefficient loading may improve an experience of the users 126 by reducingthe time taken to load native code libraries. In some implementations,the custom loader 140 may load the subset 118 into the computer readablemedia 124 in response to one of the users 126 instructing the computingdevice 102 to initiate execution of an application that uses one or moreof the native code libraries in the subset 118.

After the application package 130 has been created, the applicationpackage 130 may be sent or made available for download to the computingdevice 102. In some implementations, the server 104 may send theapplication package 130 to the computing device 102 using the network106. In other implementations, the server 104 may store the applicationpackage 130 in a download area and notify the computing device 102 thatthe application package 130 is available for download. In response, thecomputing device 102 may download the application 130 from the downloadarea.

After the computing device 102 has received or downloaded theapplication package 130, an application package installer provided by anoperating system of the computing device 102 may access the wrapperlibrary 120 in the library area 132 of the application package 132. Theapplication package installer may determine whether the wrapper library120 is stored in the application package 130 in a compressed format. Ifthe wrapper library 120 is stored in the application package 130 in acompressed format, the application package installer may uncompress thewrapper library 120. Thus, the application package installer may readthe wrapper library 120 from the application package 130, uncompress thewrapper library 120 if the wrapper library 120 is in a compressedformat, and store the wrapper library in the computer readable media124. In some cases, the application package installer may read thecustom loader 140 from the library area 132 of the application package130 and store the custom loader 140 in the computer readable media 124of the computing device 102.

The application package installer may store the application package 130in the computer readable media 124. Thus, the subset 118 may remainstored in the application package 130 until an instruction is receivedto initiate execution of one of the applications 116, which is describedin more detail in FIG. 2. In response to one of the users 126instructing the computing device 102 to initiate execution of anapplication that uses one of the native code libraries in the subset118, the custom loader 140 may load the subset 118 from the applicationpackage into the computer readable media 124. The custom loader 140 mayuncompress one or more of the native code libraries in the subset 118 ifone or more of the native code libraries in the subset 118 were storedin a compressed format in the application package 130. The custom loader140 may load the subset 118 based on the loading order 136. In someimplementations, the loading order 136 may not be specified in theapplication package 130 and may be determined prior to loading thesubset 118 into the computing device 102.

Thus, the server 104 may create an application package. The applicationpackage may include (i) a wrapper library and a custom loader stored ina library area and (ii) a subset of the native code libraries stored ina hidden area. The wrapper library may enable the applications to accessthe subset of the native code libraries. The wrapper library may berelatively small in size as compared to the subset of the native codelibraries. Thus, a time taken to install the wrapper library in thecomputing device 102 may be significantly less than a time to installthe relatively larger subset of the native code libraries, therebyimproving a user's experience when using a computing device. In someimplementations, the loading order of the subset of the native codelibraries may be determined when the application package is createdrather than when the application package is installed on the computingdevice, thereby reducing a time taken to load the subset of the nativecode libraries, further improving the user's experience when using thecomputing device.

The computer readable media 110 and 124 may include computer-readablestorage media, such as volatile memory, non-volatile memory, removablememory, and/or non-removable memory, implemented in any method ortechnology for storage of information, such as computer-readableinstructions, data structures, program modules, or other data. Also, theprocessors 108 and 122 may include onboard memory in addition to orinstead of the computer readable media 110 and 124, respectively.Examples of storage media that may be included in the computer readablemedia 110 and 124 and/or processors 108 and 122 include, but are notlimited to, non-transitory media, such as random access memory (RAM),read only memory (ROM), electrically erasable programmable read onlymemory (EEPROM), flash memory or other memory technology, compact disk(CD-ROM), digital versatile disks (DVD) or other optical storage,magnetic tape, magnetic disk storage or other magnetic storage devices,or any other medium which can be used to store the desired informationand which can be accessed by the processors 108 and 122. Any suchcomputer-readable storage media may be part of the architecture 100. Thecomputer readable media 110 and computer readable media 124 may includesoftware programs or other executable modules that may be executed bythe processors 108 and 122, respectively.

Various processes, instructions, methods and techniques described hereinmay be considered in the general context of computer-executableinstructions, such as program modules, executed by one or more computersor other devices. Generally, program modules include routines, programs,objects, components, data structures, etc. for performing particulartasks or implementing particular abstract data types. These programmodules can be implemented as software modules that execute on theprocessors 108, as hardware, and/or as firmware. Typically, thefunctionality of the program modules may be combined or distributed asdesired in various embodiments. An implementation of these modules andtechniques may be stored on or transmitted across some form ofcomputer-readable media.

FIG. 2 is an illustrative architecture 200 that includes installing awrapper library and native code libraries according to some embodiments.The architecture 200 illustrates how the custom loader 140 may loadnative code libraries from the subset 118 into the computer readablemedia 124 of the computing device 102.

The subset 118 may include one or more native code libraries, such as afirst library 202 up to an Nth library 204 (where N>0). In someimplementations, the application package 130 may include a loading order136 indicating an order in which the N libraries 202 to 204 are to beloaded from the application package 130 into the computing device 102.In other implementations, the custom loader 140 may determine theloading order 136 prior to loading the N libraries 202 to 204. Theloading order 136 may be determined based on dependencies among the Nlibraries 202 to 204. The loading order 136 may be explicit or implicit.An example of an implicit loading order may be when each of the N nativecode libraries 202 to 204 are stored in the application package 130 inan order that is based on the order in which the native code libraries202 to 204 are to be loaded into the computer readable media 124. Inthis example, the N native code libraries 202 to 204 may be read andloaded into memory using the order in which the N libraries 202 to 204are stored in the application package 130. An example of an explicitloading order may be storing a file in the application package 130 thatspecifies an order in which the N libraries 202 to 204 are to be loadedinto the computer readable media 124.

In response to the computing device 102 receiving the applicationpackage 120, an application package installer 206 (e.g., a portion of anoperating system of the computing device 102) may determine a locationof the wrapper library 120, the custom loader 140, or both. Theapplication package installer 206 may extract the wrapper library 120,the custom loader 140, or both from the application package 130 andstore the wrapper library 120, the custom loader 140, or both in thecomputer readable media 124. If the wrapper library 120, the customloader 140, or both were stored in a compressed format in theapplication package 130, the application package installer 206 mayuncompress the wrapper library 120, the custom loader 140, or both priorto storing the wrapper library 120, the custom loader 140, or both inthe computer readable media 124. The application package installer 206may store the application package 130 in the computer readable media124.

In response to the computing device 102 receiving an instruction toinitiate execution of one or more of the applications 116, theapplications 116 may be extracted into the computer readable media 124of the computing device 102, and the applications 116 may be executed bythe processors 122. At least one of the applications 116 that are beingexecuted may instruct the custom loader 140 to load the N libraries 202to 204 into the computer readable media 124. In some cases, at least oneof the applications 116 may send a request to an operating system of thecomputing device 102 to instruct the custom loader 140 to load the Nlibraries 202 to 204. The custom loader 140 may determine a size of thesubset 118 (e.g., a size of the uncompressed subset 118) and identify alocation 208 in the computer readable media 124 that is capable ofstoring the N libraries 202 to 204 based on the size. For example, thelocation 208 may be a contiguous area of the computer readable media 124that is capable of storing the N libraries 202 to 204. By identifyingthe location 208 rather than using a pre-specified location that mayalready be in use by the operating system, a conflict in which theapplication attempts to access a location that is already being used(e.g., by the operating system) may be avoided.

If the loading order 136 is implicit, the custom loader 140 may read thenative code libraries of the subset 118, starting with the first library202 and continuing up to and including the Nth library 204. The customloader 140 may uncompress the N libraries 202 to 204 if the N libraries202 to 204 are stored in a compressed format. If the loading order 136is implicit, the custom loader 140 may load the libraries 202 to 204into the computer readable media 124, starting with the first library202 and continuing on until the Nth library 204. If the loading order136 is explicit, the custom loader 140 may read the native codelibraries N libraries 202 to 204 from the application package 130 andstore the N libraries 202 to 204 in a file system (e.g., the computerreadable media 124) of the computing device 102 based on an orderspecified by the loading order 136. In some implementations, if theloading order 136 is not specified in the application package 130, thecustom loader 140 may determine the loading order 136 before loading theN libraries 202 to 204.

After the N libraries 202 to 204 have been loaded into the computerreadable media 124 of the computing device 102, the applications 116 mayaccess the N libraries 202 to 204 by calling the wrapper library 120.The wrapper library 120 may be loaded into the computer readable media124 by an application package installer 206 when the application package130 is being installed in the computing device 102.

Thus, the N libraries 202 to 204 may remain in the application package130 until an application that uses one of the N libraries 202 to 204begins executing. In some implementations, the N libraries 202 to 204may be stored in the application package 130 using a compressed format.The N libraries 202 to 204 may use less memory resources as compared toa conventional operating system approach in which the N libraries 202 to204 are stored in the application package 130 in a compressed formatwhile also being stored in the computer readable media 124 in anuncompressed format. In addition, by identifying the location 208 inwhich the N libraries 202 to 204 are loaded rather than using apredetermined location, memory conflicts may be avoided. Furthermore,the custom loader 140 may use the loading order 136 specified in theapplication package 130 when loading the N libraries 202 to 204. Byusing the loading order 136, the N libraries 202 to 204 may be loadedinto the computer readable media 124 very quickly, thereby improving theexperience of the users 126 when using the computing device 102.

Example Processes

In the flow diagrams of FIGS. 3, 4 and 5, each block represents one ormore operations that can be implemented in hardware, software, or acombination thereof. In the context of software, the blocks representcomputer-executable instructions that, when executed by one or moreprocessors, cause the processors to perform the recited operations.Generally, computer-executable instructions include routines, programs,objects, modules, components, data structures, and the like that performparticular functions or implement particular abstract data types. Theorder in which the blocks are described is not intended to be construedas a limitation, and any number of the described operations can becombined in any order and/or in parallel to implement the processes. Fordiscussion purposes, the processes 300, 400 and 500 are described withreference to the architectures 100 and 200 as described above, althoughother models, frameworks, systems and environments may implement theseprocesses.

Creating an Application Package

FIG. 3 is a flow diagram of an illustrative process 300 to create anapplication package according to some embodiments. The process 300 maybe performed by the server 104 of FIG. 1.

At 302, native code libraries used by one or more applications may beidentified. For example, in FIG. 1, the server 104 may identify thesubset 118 of the native code libraries 112 used by the one or moreapplications 116.

At 304, dependencies between the identified native code libraries may bedetermined. For example, in FIG. 1, the server 104 may determine thedependencies 128 between each of the native code libraries in the subset118.

At 306, a loading order for the identified native code libraries may bedetermined based on the dependencies. For example, in FIG. 1, the server104 may determine the loading order 136 for each of the native codelibraries in the subset 118 based on the dependencies 128. In somecases, the loading order may be determined by the custom loader 140before the custom loader 140 loads the N libraries 202 to 204 into thecomputer readable media 124.

At 308, an application package may be created. For example, in FIG. 1,the server 104 may create the application package 130.

At 310, a wrapper library may be created based on the identified nativecode libraries. For example, in FIG. 1, the wrapper library 120 may becreated based on the subset 118 of the native code libraries 112.

At 312, at least a portion of the identified native code libraries, thewrapper library, or both may be compressed.

At 314, the identified native code libraries may be stored, based on theloading order, in a hidden area of the application package. For example,in FIG. 1, the server 104 may compress at least a portion of the subset118 before storing the subset 118 in the hidden area 134 of theapplication package 130. The native code libraries in the subset 118 maybe stored in the application package 130 based on the loading order 136.

At 316, the wrapper library may be stored in a library area of theapplication package. For example, in FIG. 1, the server 104 may compressat least a portion of the wrapper library 120 before storing the wrapperlibrary 120 in the library area 132 of the application package 130. Insome cases, a custom loader to load native code libraries into a memoryof a computing device may be stored in the library area 132.

At 318, the one or more applications may be stored in the applicationpackage. For example, in FIG. 1, the server 104 may store the subset 118of the native code libraries 112 in the application package 130.

Thus, the server 104 may create the application package 132 thatincludes the library area 132 and the hidden area 134. The server 104may identify the subset 118 of the native code libraries 112 that areused by the applications 116 and store the subset 118 in the hidden area134. The server 104 may create the wrapper library 120 based on thesubset 118 and store the wrapper library 120 in the library area 132 ofthe application package 130. The server 104 may compress at least aportion of the wrapper library 120, the subset 118, or both beforestoring them in the application package 130. Storing the subset 118 inthe hidden area 134 may reduce a time taken to install the applicationpackage 130 because the wrapper library 116 rather than the subset 118is installed when the application package 130 is installed. In addition,storing the subset 118 in the hidden area 134 may reduce an amount ofthe computer readable media 124 of the computing device 102 that is usedby the subset 118 by avoiding the duplication that would result if thesubset of 118 was installed in the computer readable media 124 alongwith the application package 130. Furthermore, by determining theloading order of the subset 118 before sending the application package130 to the computing device 102, the subset 118 of the native codelibraries 112 may be quickly loaded into the computing device 102.

Installing an Application Package

FIG. 4 is a flow diagram of an illustrative process 400 to install anapplication package in a computing device according to some embodiments.The process 400 may be performed by the application package installer206 of FIG. 2.

At 402, an instruction to install an application package in a computingdevice may be received. For example, in FIG. 2, the application packageinstaller 206 may receive an instruction (e.g., from an operating systemexecuting on the computing device 102) to install the applicationpackage 130 after the application package 130 is received or downloadedfrom the server 104.

At 404, a wrapper library and/or a custom loader that are located in alibrary area of the application package may be identified. For example,in FIG. 2, the application package installer 206 may locate the wrapperlibrary 120 and/or the custom loader 140 by accessing the library area132 of the application package 130. In some cases the wrapper libraryand the custom loader may be combined into a single file that is storedin the application package.

At 406, the wrapper library may be uncompressed if the wrapper librarywas stored in the application package in a compressed format. Forexample, in FIG. 2, the application package installer 206 may uncompressthe wrapper library 120 if the wrapper library 120 was stored in acompressed format (e.g., such as zip or similar format) in theapplication package 130.

At 408, the wrapper library and/or the custom loader may be loaded intoa memory of the computing device. For example, in FIG. 2, theapplication package installer 206 may load the wrapper library 120 inthe computer readable media 124 of the computing device 102. The wrapperlibrary 120 may enable the applications 116 to directly access the Nnative code libraries 202 to 204. For example, when one of theapplications 116 calls the wrapper library 120, the wrapper library 120may forward the call, along with any arguments, to one or more of the Nlibraries 202 to 204.

At 410, the application package may be loaded into a memory of thecomputing device. For example, in FIG. 2, the application packageinstaller 206 may load the application package 130 into the computerreadable media 124 of the computing device 102.

Thus, when an application package (e.g., the application package 130) isreceived or downloaded by a computing device, an application packageinstaller may access a library area of the application package and loadany libraries (e.g., the wrapper library 120) that are stored in thelibrary area into a file system (e.g., a memory) of the computingdevice. The application package installer may load the applicationpackage into the file system of the computing device. Because thewrapper library is substantially smaller in size as compared to nativecode libraries, the application package may be installed relativelyquickly as compared to a conventional system that loads the native codelibraries into the memory of the routing device. Thus, using the process400, the amount of time to install an application package on thecomputing device 102 may be reduced.

Loading Native Code Libraries

FIG. 5 is a flow diagram of an illustrative process 500 to load nativecode libraries into a memory of a computing device according to someembodiments. The process 500 may be performed by the custom loader 140of FIG. 1 and FIG. 2.

At 502, an instruction to initiate execution of an application on acomputing device may be received. For example, in FIG. 2, an instructionmay be received from a user of the computing device 102 to initiateexecution of one or more of the applications 116.

At 504, a location of native code libraries in a hidden area of anapplication package may be identified. For example, in FIG. 2, thecustom loader 140 may determine that the N native code libraries 202 to204 are located in the hidden area 134 of the application package 130.

At 506, the native code libraries may be uncompressed if the native codelibraries were stored in a compressed format. For example, in FIG. 2,the custom loader 140 may uncompress any of the N native code libraries202 to 204 that are stored in a compressed format in the applicationpackage 130.

At 508, a location in a memory of the computing device that is capableof storing the native code libraries may be identified. For example, inFIG. 2, the custom loader 140 may identify the location 208 that iscapable of storing the N native code libraries 202 to 204 based on asize of the N native code libraries 202 to 204.

At 510, a loading order of the native code libraries may be determined.For example, in FIG. 2, the custom loader 140 may determine the loadingorder 136. The loading order 136 may be implicit based on an order inwhich the N libraries 202 to 204 are stored in the application package130 or the loading order 136 may be explicitly specified in a filelocated in the application package 130. The loading order may bedetermined based on dependencies among the N native code libraries 202to 204.

At 512, the native code libraries may be loaded into the location in thememory based on the loading order. For example, in FIG. 2, the customloader 140 may load the N libraries 202 to 204 into the computerreadable media 124 of the computing device 102.

Thus, when execution of an application that uses native code librariesis initiated, the native code libraries may be loaded into a memory of acomputing device. Because the loading order of the native code librariesis determined when the application package is created, the native codelibraries may be quickly loaded into the memory based on thepredetermined loading order. In addition, by determining a location inthe memory of the computing device that is capable of storing the nativecode libraries, rather than using a predetermined memory location,memory conflicts caused by more than one application accessing the samememory location may be avoided.

CONCLUSION

Although the subject matter has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the subject matter defined in the appended claims is notnecessarily limited to the specific features or acts described. Rather,the specific features and acts are disclosed as illustrative forms ofimplementing the claims.

What is claimed is:
 1. A method under control of one or more processorsconfigured with computer-executable instructions, the method comprising:identifying a first native code library and a second native code libraryused by an application, the first native code library and the secondnative code library comprising instructions included in an instructionset of a processor for a computer device; creating a wrapper library forthe first native code library and the second native code library, thewrapper library configured to: receive a call from the application, andtranslate the call to access at least one of the first native codelibrary or the second native code library; creating an applicationpackage that includes a custom loader, a library area, and a hiddenarea; storing the wrapper library and the custom loader in the libraryarea of the application package; storing the application in theapplication package; storing the first native code library and thesecond native code library in the hidden area, wherein the hidden areais configured to be inaccessible to an application package installer butis accessible to the custom loader, wherein the application packageinstaller is configured to install the custom loader and the wrapperlibrary, and wherein the custom loader is configured to load the firstnative code library and the second native code library from the hiddenarea into memory of the computer device based at least in part ondetermining that the application has initiated execution; compressingthe first native code library and the second native code library togenerate a compressed native code library; and sending, over one or morenetworks, the application package that includes the compressed nativecode library to the computer device.
 2. The method of claim 1, furthercomprising: determining a dependency between the first native codelibrary and the second native code library; and determining a loadingorder of the first native code library and the second native codelibrary based on the dependency.
 3. The method of claim 2, furthercomprising storing the first native code library and the second nativecode library in the hidden area of the application package based on theloading order.
 4. The method of claim 1, further comprising sending theapplication package to an operating system of the computer device toinstall the wrapper library and the custom loader on the operatingsystem.
 5. The method of claim 1, further comprising compressing atleast a portion of the wrapper library before storing the wrapperlibrary in the application package.
 6. A system comprising: one or moreprocessors; and one or more computer-readable storage media comprisinginstructions executable by the one or more processors to performoperations comprising: identifying a first native code library and asecond native code library used by a software application; creating awrapper library configured to access the first native code library andthe second native code library, the wrapper library further configuredto forward a call from the software application to the first native codelibrary and the second native code library; storing the wrapper libraryand a custom loader in a library area of an application package; storingthe first native code library and the second native code library in ahidden area of the application package, wherein the hidden area isconfigured to be inaccessible to an application package installerexecuted by a computer device but is accessible to the custom loader,wherein the application package installer is configured to install thecustom loader and the wrapper library, and wherein the custom loader isconfigured to load the first native code library and the second nativecode library from the hidden area into memory of the computer devicebased at least in part on determining that the software application hasinitiated execution; compressing the first native code library and thesecond native code library to generate a compressed native code library;and sending, over one or more networks, the application package thatincludes the compressed native code library to the computer device. 7.The system of claim 6, wherein the operations further comprisecompressing at least a portion of the wrapper library before storing thewrapper library in the application package.
 8. The system of claim 6,the operations further comprising: determining that the software hasbeen selected for execution by the computer device; and causing thehidden area to be accessed by the custom loader based at least in parton determining that the software application has been selected forexecution by the computer device.
 9. The system of claim 6, wherein thelibrary area is configured to be accessible to the application packageinstaller executed by the computer device.
 10. The system of claim 6,wherein the application package includes a plurality of additionalnative code libraries including at least the first native code libraryand the second native code library.
 11. The system of claim 6, theoperations further comprising: determining dependencies among individualones of a plurality of additional native code libraries; determining aloading order of the plurality of additional native code libraries basedon the dependencies; and storing the plurality of native code librariesin the hidden area of the application package based at least in part onthe loading order.
 12. The system of claim 11, the operations furthercomprising compressing the plurality of additional native code librariesprior to storing the plurality of native code libraries in the hiddenarea of the application package.
 13. One or more non-transitorycomputer-readable media storing instructions executable by one or moreprocessors to perform acts comprising: identifying a plurality of nativecode libraries for use by a software application, the plurality ofnative code libraries including a first native code library and a secondnative code library; creating a wrapper library configured to receive acall from the software application and to translate the call to accessat least the first native code library and the second native codelibrary; storing the wrapper library and a custom loader in a first areaof an application package; storing the plurality of native codelibraries in a secure second area of the application package, whereinthe secure second area is configured to be inaccessible to anapplication package installer but is accessible to the custom loader,wherein the application package installer is configured to install thecustom loader and the wrapper library, and wherein the custom loader isconfigured to load the first native code library and the second nativecode library from the secure second area into memory of a computerdevice based at least in part on determining that the softwareapplication has initiated execution; compressing the plurality of nativecode libraries in the secure second area to generate a compressed nativecode library; and sending, over one or more networks, the applicationpackage that includes the compressed native code library to the computerdevice.
 14. The one or more non-transitory computer-readable media ofclaim 13, wherein the first area is configured to be accessed by theapplication package installer on the computer device.
 15. The one ormore non-transitory computer-readable media of claim 13, furthercomprising: determining that the software application has been selectedfor execution by the computer device; and causing the secure second areato be accessed by the custom loader based at least in part ondetermining that the software application has been selected forexecution by the computer device.
 16. The one or more non-transitorycomputer-readable media of claim 13, further comprising compressing atleast a portion of the wrapper library before storing the wrapperlibrary in the application package.
 17. The one or more non-transitorycomputer-readable media of claim 13, further comprising: determiningdependencies between individual native code libraries of the pluralityof native code libraries; and storing individual native code librariesof the plurality of native code libraries in an order in the securesecond area of the application package, the order determined based atleast in part on the dependencies.
 18. The one or more non-transitorycomputer-readable media of claim 13, wherein the custom loader isconfigured to load the individual native code libraries of the pluralityof native code libraries into a memory of a computer device based atleast in part on an order.
 19. The one or more non-transitorycomputer-readable media of claim 13, further comprising compressing thewrapper library.